package com.ourteam.product.model.api;

import com.ourteam.frame.web.AbstractSearchModel;
import com.ourteam.product.model.dao.ProductModelPropertyRelateDAOQueryBean;
import com.ourteam.product.model.domain.ProductModelPropertyRelateBean;

public class ProductModelPropertyRelatedSearchModel
		extends AbstractSearchModel<ProductModelPropertyRelateDAOQueryBean> {

	private long objectId;

	private long relatedObjectId;

	private String relatedType;

	@Override
	public String getMappedDAOField(String aProperty) {
		return ProductModelPropertyRelateBean.getMappedDAOField(aProperty);
	}

	@Override
	protected void doBuildQueryBean(ProductModelPropertyRelateDAOQueryBean queryBean) throws Exception {

		queryBean.createCriteria().andPropertyObjectIdEqualTo(objectId)
				.andRelatedPropertyObjectIdEqualTo(relatedObjectId).andRelatedTypeEqualTo(relatedType);

	}

	public long getObjectId() {
		return objectId;
	}

	public void setObjectId(long objectId) {
		this.objectId = objectId;
	}

	public long getRelatedObjectId() {
		return relatedObjectId;
	}

	public void setRelatedObjectId(long relatedObjectId) {
		this.relatedObjectId = relatedObjectId;
	}

	public String getRelatedType() {
		return relatedType;
	}

	public void setRelatedType(String relatedType) {
		this.relatedType = relatedType;
	}

}
